<template>
	<view class="index p10 c0 f14">
		<u--form labelPosition="left" :borderBottom="false" labelWidth="auto" :labelStyle="{fontSize:'14px'}"
			:model="form" ref="uForm">
			<view class="bf p10 mb10 bs6">
				<view class="f14 p-10-0 wei6 flex">服务费率</view>
				<u-form-item label="自提/外卖商品抽佣" prop="name" ref="item1">
					<view slot="right" class="f14 c9">
						<view class="nowei" v-if="rateConfig.goods.check">
							<view v-if="rateConfig.goods.check=='scale'" class="f-c-e">
								<view class="f12">按订单百分比抽成</view>
								<view>门店获得{{rateConfig.goods.scale.storeRate}}%</view>
							</view>
							<view v-if="rateConfig.goods.check=='fixed'" class="f-c-e">
								<view class="f12">按固定金额</view>
								<view>总店抽佣{{rateConfig.goods.fixed.money}}元</view>
							</view>
						</view>
					</view>
				</u-form-item>
				<view class="mb10"></view>
				<u-form-item label="包装费抽佣" prop="name" ref="item1">
					<view slot="right" class="f14 c9">
						<view class="nowei" v-if="rateConfig.box.check">
							<view v-if="rateConfig.box.check=='scale'" class="f-c-e">
								<view class="f12">按订单百分比抽成</view>
								<view>门店获得{{rateConfig.box.scale.storeRate}}%</view>
							</view>
							<view v-if="rateConfig.box.check=='fixed'" class="f-c-e">
								<view class="f12">按固定金额</view>
								<view>总店抽佣{{rateConfig.box.fixed.money}}元</view>
							</view>
						</view>
					</view>
				</u-form-item>
				<view class="mb10"></view>
				<u-form-item label="配送费抽佣" prop="name" ref="item1">
					<view slot="right" class="f14 c9">
						<view class="nowei" v-if="rateConfig.delivery.check">
							<view v-if="rateConfig.delivery.check=='scale'" class="f-c-e">
								<view class="f12">按订单百分比抽成</view>
								<view>门店获得{{rateConfig.delivery.scale.storeRate}}%</view>
							</view>
							<view v-if="rateConfig.delivery.check=='fixed'" class="f-c-e">
								<view class="f12">按固定金额</view>
								<view>总店抽佣{{rateConfig.delivery.fixed.money}}元</view>
							</view>
						</view>
					</view>
				</u-form-item>
			</view>
			<view class="bf p10 mb12 bs6">
				<view class="f14 p-10-0 wei6">提现手续费</view>
				<!-- <u-form-item label="门店提现渠道" prop="cash" ref="item1">
					<view slot="right" class="f14 c9">
						微信，支付宝，银行卡
					</view>
				</u-form-item> -->
				<!-- <view class="mb10"></view> -->
				<u-form-item label="最低提现金额" prop="cash" ref="item1">
					<view slot="right" class="f14 c9">{{wiForm.money}}元</view>
				</u-form-item>
				<view class="mb10"></view>
				<u-form-item label="每笔抽取费率" prop="cash" ref="item1">
					<view slot="right" class="f14 c9">{{wiForm.rate}}%</view>
				</u-form-item>
				<view class="mb10"></view>
				<u-form-item label="提现手续费" prop="cash" ref="item1">
					<view slot="right" class="f14 c9">最低{{wiForm.min}}元，最高{{wiForm.max}}元</view>
				</u-form-item>
				<view class="mb10"></view>
				<u-form-item label="提现间隔周期" prop="cash" ref="item1">
					<view slot="right" class="f14 c9">{{wiForm.period}}天</view>
				</u-form-item>
			</view>
		</u--form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {

				},
				rateConfig: {
					goods: {
						check: 'scale',
						scale: {
							serverRate: '10',
							storeRate: '90',
							minMoney: '0',
						},
						fixed: {
							money: '0'
						}
					},
					box: {
						check: 'scale',
						scale: {
							serverRate: '10',
							storeRate: '90',
							minMoney: '0',
						},
						fixed: {
							money: '0'
						}
					},
					delivery: {
						check: 'scale',
						scale: {
							serverRate: '10',
							storeRate: '90',
							minMoney: '0',
						},
						fixed: {
							money: '0'
						}
					}
				},
				wiForm:{},
			}
		},
		onLoad(options) {
			this.form = JSON.parse(options.form)
			this.init()
		},
		methods: {
			init() {
				this.rateConfig = this.form.rateConfig ? this.form.rateConfig : this.rateConfig
				this.getWays()
			},
			async getWays() {
				let {
					data
				} = await this.beg.request({
					url: this.api.config,
					data:{
						ident:'withdrawalSet'
					}
				})
				this.wiForm = data
			},
		}
	}
</script>

<style lang="scss" scoped>
</style>